package com.zc.im.mapper.im.group;

import com.zc.im.model.im.group.ZcImGroupLog;
import com.zc.im.model.im.group.ZcImGroupLogExample;
import com.zc.im.model.im.group.ZcImGroupLogKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ZcImGroupLogMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    int countByExample(ZcImGroupLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    int deleteByExample(ZcImGroupLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    @Delete({
        "delete from zc_im_group_log",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(ZcImGroupLogKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    @Insert({
        "insert into zc_im_group_log (id, group_id, ",
        "title, content, ",
        "file_addr, user_id, ",
        "created_time, updated_time, ",
        "company_id, status)",
        "values (#{id,jdbcType=INTEGER}, #{groupId,jdbcType=INTEGER}, ",
        "#{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, ",
        "#{fileAddr,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, ",
        "#{createdTime,jdbcType=TIMESTAMP}, #{updatedTime,jdbcType=TIMESTAMP}, ",
        "#{companyId,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=true, resultType=Integer.class)
    int insert(ZcImGroupLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    int insertSelective(ZcImGroupLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    List<ZcImGroupLog> selectByExample(ZcImGroupLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, group_id, title, content, file_addr, user_id, created_time, updated_time, ",
        "company_id, status",
        "from zc_im_group_log",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ZcImGroupLog selectByPrimaryKey(ZcImGroupLogKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ZcImGroupLog record, @Param("example") ZcImGroupLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ZcImGroupLog record, @Param("example") ZcImGroupLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ZcImGroupLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_log
     *
     * @mbggenerated
     */
    @Update({
        "update zc_im_group_log",
        "set group_id = #{groupId,jdbcType=INTEGER},",
          "title = #{title,jdbcType=VARCHAR},",
          "content = #{content,jdbcType=VARCHAR},",
          "file_addr = #{fileAddr,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=INTEGER},",
          "created_time = #{createdTime,jdbcType=TIMESTAMP},",
          "updated_time = #{updatedTime,jdbcType=TIMESTAMP},",
          "company_id = #{companyId,jdbcType=INTEGER},",
          "status = #{status,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcImGroupLog record);
}